package classLoader;

public class Ex4 {

    interface Interface0 {
        int A = 0;
    }

    interface Interface1 extends Interface0 {
        int A = 1;
    }

    interface Interface2 {
        int A = 2;
    }

    static class Parent implements Interface1 {
        public static int A = 3;
    }

    static class Sub extends Parent implements Interface2 {
        public static int A = 4;
    }

    public static void main(String[] args) {
        System.out.println(Sub.A);
    }

}

/* 
4

作者在书上想说明，如果注释掉Sub中的 public static int A = 4;那么直接引用Sub.A，就会显示ambiguous。因为不知道是使用接口的A还是父类的A。

*/
